package com.theme.passport.controller.sys;

import com.theme.common.mvc.utils.PageUtils;
import com.theme.common.mvc.view.R;
import com.theme.passport.entity.SysReviewLogEntity;
import com.theme.passport.service.SysReviewLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 审核日志
 *
 * @author live
 * @email 870459550@qq.com
 * @date 2020-08-12 08:53:53
 */
@RestController
@RequestMapping("sys/review-log")
public class SysReviewLogController {
    @Autowired
    private SysReviewLogService reviewLogService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sys:review-log:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = reviewLogService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("sys:review-log:info")
    public R info(@PathVariable("id") Long id){
		SysReviewLogEntity wkaReviewLog = reviewLogService.getById(id);

        return R.ok().put("wkaReviewLog", wkaReviewLog);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("sys:review-log:save")
    public R save(@RequestBody SysReviewLogEntity wkaReviewLog){
		reviewLogService.save(wkaReviewLog);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("sys:review-log:update")
    public R update(@RequestBody SysReviewLogEntity wkaReviewLog){
		reviewLogService.updateById(wkaReviewLog);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("sys:review-log:delete")
    public R delete(@RequestBody Long[] ids){
		reviewLogService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
